import request from "@/utils/request";

// 获取黑名单列表
export function getBlacklist(params) {
  return request({
    url: "/admin/users/blacklist",
    method: "get",
    params,
  });
}

// 添加用户到黑名单
export function addToBlacklist(data) {
  return request({
    url: "/admin/users/blacklist",
    method: "post",
    data,
  });
}

// 更新黑名单项
export function updateBlacklistItem(data) {
  return request({
    url: `/admin/users/blacklist/${data.id}`,
    method: "put",
    data,
  });
}

// 从黑名单中移除
export function removeFromBlacklist(id) {
  return request({
    url: `/admin/users/blacklist/${id}`,
    method: "delete",
  });
}

// 批量从黑名单中移除
export function batchRemoveFromBlacklist(ids) {
  return request({
    url: "/admin/users/blacklist/batch",
    method: "delete",
    data: { ids },
  });
}

// 导出黑名单数据
export function exportBlacklistData(params) {
  return request({
    url: "/admin/users/blacklist/export",
    method: "get",
    params,
    responseType: "blob",
  });
}
